import request from '@/utils/request';
import {getEW} from "@/utils/utils";

export async function query({...resetParams}) {
  return request(`/daily_payment_reports`,{
    method:'GET',
    params:{
      ...resetParams,
      order_direction:'desc',company_ids:getEW(resetParams.company_ids),
    }
  });
}
export async function remove({id}) {
  return request(`/daily_payment_reports/${id}`, {
    method: 'DELETE',
  });
}

export async function add(payload) {
  return request(`/daily_payment_reports`, {
    method: 'POST',
    data: {
      ...payload,
    },
  });
}

export async function edit({id,...restParams}) {
  return request(`/daily_payment_reports/${id}`, {
    method: 'PUT',
    data: {
      ...restParams,
    },
  });
}
